﻿/************************************************************************

   Extended Silverlight Toolkit

   Copyright (C) 2010-2012 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://extendedsilverlight.codeplex.com/license

   Please purchase a commercial version of this toolkit if you are using
   it in a commercial product. The commercial versions support the project,
   and also include more features for each control, priority support,
   source code, updates, removed watermark, and a proprietary license.

   Visit http://xceed.com and follow @datagrid on Twitter.

  **********************************************************************/


namespace Xceed.Silverlight.Data
{
  internal struct JumpMoveAndFetchParameters
  {
    #region Constructors

    internal JumpMoveAndFetchParameters(
      SourcePosition sourcePosition,
      long expectedMoveCount,
      int expectedFetchCount )
      : this( sourcePosition, expectedMoveCount, expectedFetchCount, null )
    {
    }

    internal JumpMoveAndFetchParameters(
      SourcePosition sourcePosition,
      long expectedMoveCount,
      int expectedFetchCount,
      bool approximateMove )
      : this( sourcePosition, expectedMoveCount, expectedFetchCount, approximateMove, null )
    {
    }

    internal JumpMoveAndFetchParameters(
      SourcePosition sourcePosition,
      long expectedMoveCount,
      int expectedFetchCount,
      DataSourceContext context )
      : this( sourcePosition, expectedMoveCount, expectedFetchCount, false, context )
    {
    }

    internal JumpMoveAndFetchParameters(
      SourcePosition sourcePosition,
      long expectedMoveCount,
      int expectedFetchCount,
      bool approximateMove,
      DataSourceContext context )
    {
      m_sourcePosition = sourcePosition;
      m_expectedMoveCount = expectedMoveCount;
      m_expectedFetchCount = expectedFetchCount;
      m_approximateMove = approximateMove;
      m_context = context;
    }

    #endregion

    #region SourcePosition Property

    internal SourcePosition SourcePosition
    {
      get
      {
        return m_sourcePosition;
      }
    }

    #endregion SourcePosition Property

    #region ExpectedMoveCount Property

    internal long ExpectedMoveCount
    {
      get
      {
        return m_expectedMoveCount;
      }
    }

    #endregion ExpectedMoveCount Property

    #region ExpectedFetchCount Property

    internal int ExpectedFetchCount
    {
      get
      {
        return m_expectedFetchCount;
      }
    }

    #endregion ExpectedFetchCount Property

    #region ApproximateMove Property

    internal bool ApproximateMove
    {
      get
      {
        return m_approximateMove;
      }
    }

    #endregion ApproximateMove Property

    #region Context Property

    internal DataSourceContext Context
    {
      get
      {
        return m_context;
      }
    }

    #endregion

#if DEBUG
    public override string ToString()
    {
      return string.Format( "ExpMove={0}, ExpFetch={1}, SourcePos={2}", this.ExpectedMoveCount, this.ExpectedFetchCount, this.SourcePosition );
    }
#endif  //DEBUG

    #region Private Fields

    private SourcePosition m_sourcePosition;
    private long m_expectedMoveCount;
    private int m_expectedFetchCount;
    private bool m_approximateMove;
    private DataSourceContext m_context;

    #endregion
  }
}
